import request from "@/utils/request";

export function getInspectionTaskByPage(query) {
  return request({
    url: `/system/inspectionTask/getInspectionTaskByPage`,
    method: "post",
    data: query,
  });
}

export function getInspectionTaskTemplateSamplingItemByPage(query) {
  return request({
    url: `/system/inspectionTask/getInspectionTaskTemplateSamplingItemByPage`,
    method: "post",
    data: query,
  });
}

/**
 * 代码修改提交
 * @param {*} query
 * @returns
 */
export function copyInspectionTaskTemplateSamplingItem(query) {
  return request({
    url: `/system/inspectionTask/copyInspectionTaskTemplateSamplingItem`,
    method: "post",
    data: query,
  });
}

/**
 * 输入全局数据
 * @param {*} query
 * @returns
 */
export function fillInspectionSamplingTaskValue(query) {
  return request({
    url: `/system/inspectionTask/fillInspectionSamplingTaskValue`,
    method: "post",
    data: query,
  });
}

/**
 * 导入额外数据
 * @param {*} query
 * @returns
 */
export function fillInspectionTaskValueExt(query) {
  return request({
    url: `/system/inspectionTask/fillInspectionTaskValueExt`,
    method: "post",
    data: query,
  });
}

// 增加流程模型

export function addInspectionTask(query) {
  return request({
    url: `/system/inspectionTask/addInspectionTask`,
    method: "post",
    data: query,
  });
}

export function addInspectionTasks(query) {
  return request({
    url: `/system/inspectionTask/addInspectionTasks`,
    method: "post",
    data: query,
  });
}
/**
 *
 * @param {*} query
 * @returns
 */
export function delInspectionTask(query) {
  return request({
    url: `/system/inspectionTask/delInspectionTask`,
    method: "post",
    data: query,
  });
}

export function updateInspectionTask(query) {
  return request({
    url: `/system/inspectionTask/updateInspectionTask`,
    method: "post",
    data: query,
  });
}

export function getValueTmpByTaskId(query) {
  return request({
    url: `/system/inspectionTask/getValueTmpByTaskId`,
    method: "post",
    data: query,
  });
}

export function fillInspectionTaskValue(query) {
  return request({
    url: `/system/inspectionTask/fillInspectionTaskValue`,
    method: "post",
    data: query,
  });
}

export function addInspectionTaskValues(query) {
  return request({
    url: `/system/inspectionTaskValue/addInspectionTaskValues`,
    method: "post",
    data: query,
  });
}

export function uploadFile(params) {
  return request("/file/upload", {
    method: "POST",
    data: params,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
  });
}
